import { request } from '@/utils/request'

/**
 * 登录
 */
export function doLogin (data) {
  return request({
    url: '/auth/login',
    method: 'post',
    data
  })
}

/**
 * 获取已登录用户的信息
 */
export function doGetInfo () {
  return request({
    url: '/auth/user-info',
    method: 'get'
  })
}

/**
 * 退出登录
 */
export function doLogout () {
  return request({
    url: '/auth/logout',
    method: 'post'
  })
}

/**
 * 刷新token
 */
export function refreshToken () {
  return request({
    url: '/auth/refresh-token',
    method: 'get'
  })
}